<?php
include_once "mdbtable.php";

class MSetting extends MDbTable {

	public $table = "settings";

	public function getMe($user_id = null)
	{
		if(!$user_id) $user_id = Auth::$user_id;
		$s = $this->getFirstRow(array('user_id' => $user_id));
		$s['format_kro'] = @$s['format_kro'] ? $s['format_kro'] : DEFAULT_FORMAT_KRO;
		$s['valuta'] = @$s['valuta'] ? $s['valuta'] : 'R';
		$s['time_zone'] = @$s['time_zone'] ? $s['time_zone'] : MOSCOW_TIME_ZONE;
		$s['znak_drob'] = @$s['znak_drob'] ? $s['znak_drob'] : DEFAULT_ZNAK_DROB;
		$s['send_email_more'] = @$s['send_email_more'] ? $s['send_email_more'] : 0;
		return $s;
	}
}

